// import Vue from 'vue'

const app = {
  state: {
    wechatType: 0, // 1-总 0-子
    projectList: [],
    curProjectId: null,
    curProjectName: '',
    cusFmobile: null,
    sysAllDictItems:null,
    access_token: '',
    ticket: ''
  },
  mutations: {
    SET_Ticket: (state, ticket) => {
      state.ticket = ticket
    },
    SET_ACCESS_TOKEN: (state, access_token) => {
      state.access_token = access_token
    },
    SET_PROJECT: (state, curProject) => {
      state.curProjectId = curProject.id
      state.curProjectName= curProject.name
    },
    SET_WECHATTYPE: (state, type) => {
      state.wechatType = type
    },
    SET_CUSFMOIBLE: (state, cusFmobile) => {
      state.cusFmobile = cusFmobile
    },
    SET_DICTITEMS: (state, sysAllDictItems) => {
      state.sysAllDictItems = sysAllDictItems
    },
    SET_PROJECTLIST: (state, projectList) => {
      state.projectList = projectList
    }
  },
  actions: {
    SetTicket: ({ commit }, ticket) => {
      commit('SET_Ticket', ticket)
    },
    SetACCESSTOKEN: ({ commit }, access_token) => {
      commit('SET_ACCESS_TOKEN', access_token)
    },
    SetProject: ({ commit }, curProject) => {
      commit('SET_PROJECT', curProject)
    },
    SetWechatType: ({ commit }, type) => {
      commit('SET_WECHATTYPE', type)
    },
    SetCurCusFmobile: ({ commit }, cusFmobile) => {
      commit('SET_CUSFMOIBLE', cusFmobile)
    },
    SetDictItems: ({ commit }, sysAllDictItems) => {
      commit('SET_DICTITEMS', sysAllDictItems)
    },
    SetProjectList: ({ commit }, projectList) => {
      commit('SET_PROJECTLIST', projectList)
    }
  }
}

export default app
